
{% extends "base.html" %}
{% block title %} 图片上传 {% endblock title %}
{% block content %}
<div class="container">
    <div class="row">
        <div class="col-12">
            <br>
            <div class="col-md-4">valentine 图片操作</div>
            <hr>
            <div> <span> 图片数量 {{ photo_list.count }}</span> </div>
            <br>
            <div class="col">

                {% for p in photo_list %}
                 <img src="{{ p.photo.url }}" style="max-width: 20%; border-radius: 15%; padding-bottom: 10px" class="col-md-4">
                {% endfor %}
            </div>


            <form method="post" action="." enctype="multipart/form-data">
                {% csrf_token %}
                 <div class="form-group col-md-4">
                    <label for="photo">上传图片</label>
                    <input type="file" class="form-control-file" name="photo" id="photo">
                 </div>

                <div class="form-group col-md-4">
                    <label for="name">图片名称</label>
                    <input type="text" class="form-control" id="name" name="name" >
                </div>

                <div class="form-group col-md-4">
                    <label for="words">图片寄语</label>
                    <textarea type="text" class="form-control" id="words" name="words" rows="3"></textarea>
                </div>
                <!-- 提交按钮 -->
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </div>
    </div>
</div>
{% endblock content %}